//
//  CinemaTableViewController.h
//  ShowTimeApp
//
//  Created by Ruby on 10/21/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CinemaDataModel.h"
#import "MovieDataModel.h"
#import "ShowtimeDataModel.h"
#import "TicketInfoDataModel.h"
#import "CinemaService.h"
#import "ServiceAccessHelper.h"

@interface CinemaTableViewController : UITableViewController<CinemaServiceSoapBindingResponseDelegate> {
    //Data Array from webservice
    NSMutableArray *svCinemaList,*svMovieList,*svTicketInfo,*svShowTime;
    NSMutableArray *dbcinemaList;
    NSMutableArray *filteredCinemaArray;
    //DataModel class library for querying data from core data
    CinemaDataModel *cinemaDataModel;
    MovieDataModel *movieDataModel;
    ShowtimeDataModel *showtimeDataModel;
    TicketInfoDataModel *ticketInfoDataModel;
    //Spinner spin while loading data from service
    UIActivityIndicatorView * spinner; 
    ServiceAccessHelper* serviceAccess;
    NSString* tableName;
    //UIControl for searching function
    UISearchBar *searchBar;
    UISearchDisplayController *searchDC;
    NSMutableDictionary *cinemaList;
}

@property (retain) NSMutableArray *dbcinemaList,*svCinemaList,*svMovieList,*svTicketInfo,*svShowTime,*filteredCinemaArray;
@property (retain) NSMutableDictionary *cinemaList;
@property (retain) UISearchBar *searchBar;
@property (retain) UISearchDisplayController *searchDC;
@property (retain) IBOutlet UIActivityIndicatorView *spinner;

-(void)initSpinner;
-(void)initServiceAccessHelper;
-(void)initDataModel;
-(void)getCinemaListAsyncFromSV;
-(void)getMovieListAsyncFromSV;
-(void)getTicketInfoListAsyncFromSV;
-(void)getShowTimeListAsyncFromSV;
-(BOOL)saveAllDataToDeviceDB;
-(void)getCinemaListFromDB;
-(BOOL)saveChanges;
@end
